$("#submit_online").click(function(){
	var need_moeny = $("#need_moeny").val();
	var user_moeny_left = $("#user_moeny_left").val();
	if(need_moeny>user_moeny_left){
		var used_moeny = $("#user_moeny").val();
		if(used_moeny>user_moeny_left){
			$("#online_pay_error").css("color","red");
			$("#online_pay_error").html("余额超出最大使用值");
			return;
		}
		if(used_moeny<0){
			$("#user_moeny").attr("value",0);	
		}
	}
	
	var pay_checked=false;
	$("input[name='pay_type_online']").each(function(){
		var checked = $(this).attr("checked");
		if(checked=='checked'){
			pay_checked = true;
		}
	})
	
	if(pay_checked==true){
		openOkAndNo();
		document.Wusec25.submit();
	}else{
		$("#online_pay_error").css("color","red");
		$("#online_pay_error").html("请选择支付方式");		
	}
})


function openOkAndNo(){
	$('#floatDivCover').fadeIn(100);
	$('#OkAndNo').slideDown("fast");
	$('#OkAndNo input').click(function(){
	$('#OkAndNo').slideUp("fast");$('#floatDivCover').fadeOut(500);});
}

$("#submit_pay_usermoeny").click(function(){
	var checked = $("#pay_type_usermoeny").attr("checked");
	if(checked=='checked'){
		document.Yuess.submit();
	}else{
		$("#pay_type_usermoeny_error").css("color","red");
		$("#pay_type_usermoeny_error").html("请选择支付方式");		
	}
})

$("#submit_pay_remit").click(function(){
	var checked = $("#pay_type_remit").attr("checked");
	if(checked=='checked'){
		document.Wusec26.submit();
	}else{
		$("#pay_type_remit_error").css("color","red");
		$("#pay_type_remit_error").html("请选择支付方式");		
	}
})

$("#user_moeny").change(function(){
	var used_moeny = $(this).val();
	var user_moeny_left = $("#user_moeny_left").val();
	if(used_moeny>user_moeny_left){
		$("#online_pay_error").css("color","red");
		$("#online_pay_error").html("余额超出最大使用值");
		return;
	}else{
		$("#online_pay_error").html("");
	}
	if(used_moeny<0){
		$(this).attr("value",0);	
	}
})

$("#complete_pay").click(function(){
	location.href="user_paysuccess.htm";
})


$("#uncomplete_pay").click(function(){
	location.href="user_financing.html?opage=1";
})


function check(object) {
	var value=object.value;
	$("#bank_type_value").attr("value",value);
}